package com.queming.music.entity;

import com.queming.core.entity.File;
import com.queming.core.entity.TraceableBaseEntity;
import com.queming.music.enums.PlayListStatus;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

/**
 * @author chencidiao
 * @date 2022/05/05 21:17
 **/
@Entity
@Data
public class Playlist extends TraceableBaseEntity {
    private String name;

    private String description;

    @OneToOne
    private File cover;

    @Enumerated(EnumType.STRING)
    private PlayListStatus status=PlayListStatus.DRAFT;



    @ManyToMany
    @JoinTable(name = "playlist_music",
               joinColumns = @JoinColumn(name = "playlist_id",referencedColumnName = "id")
               ,inverseJoinColumns =@JoinColumn(name = "music_id",referencedColumnName = "id") )
    private List<Music> musicList;

    //是否被推荐
    private Boolean recommended=false;

    //推荐因素
    private Integer recommendedFactor=0;

    private Boolean special=false;
}
